<%@page import="org.apache.naming.java.javaURLContextFactory"%>
<%@page import="java.text.ParseException"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.*"%>
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="d" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Document sans titre</title>
        <link href="styles.css" rel="stylesheet" type="text/css"/>
    </head>
    <body >
       
        <sql:query var = "queryresults" dataSource = "jdbc/WebTest1"> 
            select * from comits_base.commande
        </sql:query> 
             
        <div class="text" align="center">
            <p><% Calendar cal = Calendar.getInstance();
                int annee = cal.get(Calendar.YEAR);
                int mois = cal.get(Calendar.MONTH) + 1;
                int jour = cal.get(Calendar.DAY_OF_MONTH);
                int f = cal.get(Calendar.WEEK_OF_YEAR);
                java.util.Date d = new java.util.Date();

                cal.setTime(d);

                int week = cal.get(Calendar.WEEK_OF_YEAR);


                out.println("semaine" + week);



                cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);

                out.println("Planning des approvisionnements de la semaine  - " + f);

                DateFormat df = new SimpleDateFormat("EEEE dd/MM/yyyy");

                out.println(" du  " + df.format(cal.getTime()));
                cal.add(Calendar.DATE, 4);
                out.println(" au " + df.format(cal.getTime()));

                %>   </p>
        </div>
       
    </body>
</html>
